package cn.sciento.boot.transfer.api.dto;

import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import cn.sciento.boot.transfer.domain.entity.ProducerEvent;

public class EventSendDTO {
  @ApiModelProperty("表ID，主键。全局ID")
  private Long eventId;
  
  @ApiModelProperty("处理数据租户ID")
  private Long sourceTenantId;
  
  @ApiModelProperty("事件类型")
  private String eventType;
  
  @ApiModelProperty("服务名")
  private String sourceService;
  
  @ApiModelProperty("处理表，也是消息TOPIC")
  private String sourceTable;
  
  @ApiModelProperty("消息产生时间")
  private Date produceTime;
  
  @ApiModelProperty("消息内容")
  private String messages;
  
  @ApiModelProperty("处理状态，参考：HDTT.EVENT_PROCESS_STATUS")
  private String processStatus;
  
  @ApiModelProperty("处理消息")
  private String processMsg;
  
  @ApiModelProperty("处理时间")
  private Date processTime;
  
  public static EventSendDTO createInstance(ProducerEvent producerEvent) {
    EventSendDTO eventSend = new EventSendDTO();
    eventSend.setEventId(producerEvent.getEventId());
    eventSend.setEventType(producerEvent.getEventType());
    eventSend.setMessages(producerEvent.getMessages());
    eventSend.setProcessStatus(producerEvent.getProcessStatus());
    eventSend.setProduceTime(producerEvent.getProduceTime());
    eventSend.setSourceTable(producerEvent.getSourceTable());
    eventSend.setSourceService(producerEvent.getSourceService());
    eventSend.setProcessTime(producerEvent.getProcessTime());
    eventSend.setProcessMsg(producerEvent.getProcessMsg());
    eventSend.setSourceTenantId(producerEvent.getSourceTenantId());
    return eventSend;
  }
  
  public Long getEventId() {
    return this.eventId;
  }
  
  public void setEventId(Long eventId) {
    this.eventId = eventId;
  }
  
  public String getEventType() {
    return this.eventType;
  }
  
  public void setEventType(String eventType) {
    this.eventType = eventType;
  }
  
  public String getSourceService() {
    return this.sourceService;
  }
  
  public void setSourceService(String sourceService) {
    this.sourceService = sourceService;
  }
  
  public String getSourceTable() {
    return this.sourceTable;
  }
  
  public void setSourceTable(String sourceTable) {
    this.sourceTable = sourceTable;
  }
  
  public Date getProduceTime() {
    return this.produceTime;
  }
  
  public void setProduceTime(Date produceTime) {
    this.produceTime = produceTime;
  }
  
  public String getMessages() {
    return this.messages;
  }
  
  public void setMessages(String messages) {
    this.messages = messages;
  }
  
  public String getProcessStatus() {
    return this.processStatus;
  }
  
  public void setProcessStatus(String processStatus) {
    this.processStatus = processStatus;
  }
  
  public String getProcessMsg() {
    return this.processMsg;
  }
  
  public void setProcessMsg(String processMsg) {
    this.processMsg = processMsg;
  }
  
  public Date getProcessTime() {
    return this.processTime;
  }
  
  public void setProcessTime(Date processTime) {
    this.processTime = processTime;
  }
  
  public Long getSourceTenantId() {
    return this.sourceTenantId;
  }
  
  public void setSourceTenantId(Long sourceTenantId) {
    this.sourceTenantId = sourceTenantId;
  }
}
